home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / de.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.5 KB  |  70 lines

  1. <!--- This shows the use of DE and Evaluate --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6.  
  7. <TITLE>
  8. DE Example
  9. </TITLE>
  10.  
  11. </HEAD>
  12.  
  13. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  14. <BODY  bgcolor="#FFFFD5">
  15.  
  16. <H3>DE Example</H3>
  17.  
  18. <P>This file has been disabled for online viewing. Please use your copy of ColdFusion to view this example. 
  19.  
  20. <!---
  21. <CFIF IsDefined("form.myExpression")>
  22. <H3>The Expression Result</H3>
  23.  
  24. <CFTRY>
  25. <!--- Evaluate the expression --->
  26. <CFSET myExpression = Evaluate(form.myExpression)>
  27.  
  28. <!--- Use DE to output the value of the variable, unevaluated --->
  29. <CFOUTPUT>
  30. <I>The value of the expression #Evaluate(DE(form.MyExpression))#
  31. is #MyExpression#.</I>
  32. </CFOUTPUT>
  33.  
  34.  
  35. <!--- specify the type of error for which we are fishing --->
  36. <CFCATCH TYPE="Any">
  37. <!--- the message to display --->
  38.     <H3>Sorry, there's been an <B>Error</B>.
  39.     Try a simple expression, such as "2+2".</H3>
  40. <CFOUTPUT>
  41. <!--- and the diagnostic message from the Cold
  42. Fusion server --->
  43.     <P>#CFCATCH.message#
  44. </CFOUTPUT>
  45. </CFCATCH>
  46.  
  47. </CFTRY>
  48.  
  49.  
  50. </CFIF>
  51.  
  52. <H3>Simple Expression Evaluator</H3>
  53. <P>Input a simple expression (e.g., 2+2) or 
  54. A simple expression combined with CFML (e.g., 
  55. 32 MOD 9) and see the result, as well as the 
  56. name of the variable used to hold the information.
  57.  
  58.  
  59. <FORM ACTION="de.cfm" METHOD="POST">
  60. <INPUT TYPE="Text" NAME="MyExpression" VALUE="2 + 2">
  61.  
  62. <INPUT TYPE="Submit" NAME="" VALUE="Evaluate my expression">
  63.  
  64. </FORM>
  65.  --->
  66.  
  67. </BODY>
  68.  
  69. </HTML>       
  70.